1. Calico Document Tools and Bibtex

This notebook describes an alternative Bibtex tool that differs from other Jupyter/IPython extensions:

  1. https://github.com/takluyver/cite2c
  2. http://nbviewer.ipython.org/github/HHammond/nbconvert-examples/blob/master/citations/Tutorial.ipynb
  3. http://nbviewer.ipython.org/gist/z-m-k/6080008/ipyBibtex.ipynb

The main differences:

  • Uses standard Markdown to represent citations and references
  • Can keep the bibtex entries (the database) inside the notebook
  • Optionally can use a Bibliography.ipynb in folder (or in a parent folder)

1.1 Installation

sudo ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-document-tools-1.0.zip

At some point after installing, you need to load the nbextension:

IPython.load_extensions('calico-document-tools');

That will add the "Generate References" button (and others as well---see Futher Information below).

1.2 Adding a Bibtex Database to the Notebook

First, one can include Bibtex entries any where in a notebook. I put them at the end.

The Bibtex database is in a Markdown cell, as a HTML-comment (with "bibtex") marked as follows:

<!--bibtex

@Article{PER-GRA:2007,
  Author    = {P\'erez, Fernando and Granger, Brian E.},
  Title     = {{IP}ython: a System for Interactive Scientific Computing},
  Journal   = {Computing in Science and Engineering},
  Volume    = {9},
  Number    = {3},
  Pages     = {21--29},
  month     = may,
  year      = 2007,
  url       = "http://ipython.org",
  ISSN      = "1521-9615",
  doi       = {10.1109/MCSE.2007.53},
  publisher = {IEEE Computer Society},
}

... Other Bibtex entries go here.

-->

Next, you can reference the Bibtex item in Markdown cells using this format:

[cite](#cite-BIBTEX_LABEL)

where BIBTEX_LABEL would be something like PER-GRA:2007.

1.3 Example Use

You would write:

Thus, if you want to cite IPython, then you could use that 
citation [cite](#cite-PER-GRA:2007)

That won't look like a real citation until you render the References by pressing the "Generate References" button. It then becomes:

Thus, if you want to cite IPython, then you could use that 
citation <a name="ref-1"/>[(Pérez and Granger, 2007)](#cite-PER-GRA:2007)

It will automatically do the following:

  • The citation will be replaced with the proper text
  • A Reference section will be added at the end of the notebook
  • Links will be generated that:
    • take you to the citation to the Reference
    • take you from the Reference to the citation

Here is the real markdown:

Thus, if you want to cite IPython, then you could use that citation (Pérez and Granger, 2007)

Optional Bibliography.ipynb

In addition to having the bibliography information stored directly in a notebook (which is highly preferred for reproducible research) you can also create a Bibliography.ipynb in this directory, or a parent directory. See below for further information.

1.4 Further Information

1.5 Future work and Limitations